import 'package:gzmall_app/model/brand.dart';
import 'package:gzmall_app/model/product.dart';
import 'package:json_annotation/json_annotation.dart';
import 'package:gzmall_app/model/store.dart';

part 'favorites.g.dart';

@JsonSerializable()
class Favorites extends Object {
  @JsonKey(name: 'id')
  int id;

  @JsonKey(name: 'spu')
  Product spu;

  @JsonKey(name: 'brand')
  Brand brand;

  @JsonKey(name: 'shop')
  Store shop;

  Favorites(
    this.id,
    this.spu,
    this.brand,
    this.shop,
  );

  factory Favorites.fromJson(Map<String, dynamic> srcJson) =>
      _$FavoritesFromJson(srcJson);
}
